<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/8/18 0018
 * Time: 下午 1:54
 * 王晔 商家的验证类
 */
namespace app\common\validate;
use think\Validate;

class  Shop extends Validate {
    protected $rule=[
        'shop_username'=>['require','unique:shop','max:20','min:4'],//登录名
        'shop_name'=>['require','unique:shop','max:20','min:4'],//商户名称
        'shop_address'=>['require'],//商户地址
        'shop_tel'=>['require','unique:shop','/^1[345678]\d{9}$/']//商户联系电话
    ];
    //验证不符返回msg
    protected $message  =   [
        //登录名验证信息
        'shop_username.require'   => '账号必须填写！',
        'shop_username.min'   => '账号最短四位!',
        'shop_username.max'   => '账号最长二十位!',
        'shop_username.unique'   => '账号已存在！',
        //商户名称验证信息
        'shop_name.require'   => '/商户名称必须填写！',
        'shop_name.min'   => '/商户名称最短四位!',
        'shop_name.max'   => '/商户名称最长二十位!',
        'shop_name.unique'   => '名称已存在！',
        //商户地址验证信息
        'shop_address.require'   => '商户地址必须填写！',
      //商户联系电话验证信息
		'shop_tel.unique'   => '手机号已存在！',
		'shop_tel.require'   => '手机号必须填写！',
		'shop_tel'   => '手机号格式错误,请输入正确的手机号！',
    ];
}